from kafka import KafkaConsumer

if __name__ == '__main__':
    consumer = KafkaConsumer(bootstrap_servers="master:9092,node1:9092,node2:9092", group_id="df3s2agf",
                             auto_offset_reset="earliest")

    consumer.subscribe(topics=["bigdata"])

    kv_consumer = consumer.poll(timeout_ms=1000)
    for k,v in kv_consumer.items():
        for vs in v:
            print(vs.value.decode("utf-8"))

